package io.jpress.module.club.web;

import com.jfinal.plugin.activerecord.Page;
import io.jboot.web.controller.annotation.RequestMapping;
import io.jpress.core.menu.annotation.AdminMenu;
import io.jpress.module.club.model.Post;
import io.jpress.module.club.service.PostService;
import io.jpress.web.base.AdminControllerBase;

import javax.inject.Inject;

@RequestMapping("/admin/club")
public class _ClubController extends AdminControllerBase {

    @Inject
    private PostService postService;

    @AdminMenu(groupId = "club",text = "留言管理")
    public void index(){
        Page<Post> page = (Page<Post>) postService.paginate(getPagePara(),10);

        setAttr("page",page);

        render("club/club_list.html");
    }

    @AdminMenu(groupId = "club",text = "版块管理")
    public void category(){

        renderText("版块管理");
    }

    @AdminMenu(groupId = "club",text = "帖子评论")
    public void comment(){

        renderText("帖子评论");
    }
}
